package com.springcloud.learn;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @author Edison_lv  lvchangrong
 * @create 2017/11/30  16:15
 */
@Component
public class Sender {


    @Autowired
    private AmqpTemplate amqpTemplate;

    public void send(){
        String context = "hello rabbitmq "+new Date();
        System.out.println("Sender =============== :"+context);
        this.amqpTemplate.convertAndSend("hello",context);
    }
}
